<template>
  <div id="app">
    <h1 style="text-align:center">淘集集项目开发</h1>
    <judge-env></judge-env>
    <div>
      <!-- <tab :line-width="2" active-color="#fc378c" v-model="index">
        <tab-item class="vux-center" :selected="demo2 === item" v-for="(item, index) in list2" @click="demo2 = item" :key="index">{{item}}</tab-item>
      </tab> -->
      <!-- <swiper v-model="index" height="100px" :show-dots="false">
        <swiper-item v-for="(item, index) in list2" :key="index">
          <div class="tab-swiper vux-center" v-for="(item, i) in goodsList" :key="i">{{ item.goodsId }}</div>
        </swiper-item>
      </swiper> -->
      <ul>
        <li v-for="(item, i ) in pageList" :key="i">
          <a :href="item">{{ item }}</a>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
import {
  Tab,
  TabItem,
  Sticky,
  Divider,
  XButton,
  Swiper,
  SwiperItem
} from "vux";
const list = () => ["精选", "美食", "电影", "酒店", "外卖"];
import Lib from "assets/js/Lib";
import judgeEnv from "@/components/judgeEnv";
import { querystring } from "vux";
import { setTimeout } from "timers";
const a = require('@/views/app.json')
// var fs = require('fs');
export default {
  data() {
    return {
      index: 0,
      list2: list(),
      demo2: "精选",
      topId: "1214925,1214827,1214829,1214907,1214911,1214908,1214909",
      goodsList: [],
      pageList: []
    };
  },

  components: {
    judgeEnv,
    Tab,
    TabItem,
    Sticky,
    Divider,
    XButton,
    Swiper,
    SwiperItem
  },
  created() {
    var pages = a.pages;
    this.pageList = pages.map(res => {
      return window.location.origin + '/views/' + res;
    })

    this.$http.get(`/static/goods.json`).then(res => {

    })   

    //  this.$http.get(`http://localhost:8091/static/goods.json`).then(res => {

    // })

    console.log(this.pageList);
    
    // var a = querystring.parse(window.location.search);
    // this.$http
    //   .post(
    //     this.$apis.apis.goodsListCoupon,
    //     this.$qs.stringify({
    //       user_id: 1,
    //       token: 1,
    //       uuid: 1,
    //       goodsIds: this.topId
    //     })
    //   )
    //   .then(({data}) => {
    //     this.goodsList  = data.data;
    //     console.log(this.goodsList)
    //   });
  },

  //相关操作事件
  methods: {}
};
</script>

<style lang="less">
</style>
